All Questions
21 questions
-1votes
3answers
109views
sed command gets me error Label too long: on solaris
Given database name oltt206 or DB01 i wish to extract its respective username, password and connection string from the xml below: wladmin@myremhost:/tmp$ cat /web/bea_apps/uat/Tomcat_Home_v9.0.56/...
0votes
3answers
205views
How to get all numbers AND IPs from string using regex?
Let's say I have the following example string: <ETH0_IP><![CDATA[10.0.100.10]]></ETH0_IP> I would like to extract the first number and the IP in the following format: 0 10.0.100.10 ...
-1votes
1answer
1kviews
How to extract mutliple text lines within xml file by using grep and/or sed
I am trying to extract some lines within a <w:t> tag in front and </w:t> tag at the end of the text I want, but im only getting the text within last tags and not the others. How can i do ...
0votes
5answers
4kviews
How to insert a newline character after each occurrence of a specific XML tag in a file?
How to insert a newline character after each occurrence of a specific XML tag in a file? My file has multiple tags </Data> and I want to insert a NewLine character after each </Data> tag I'...
0votes
3answers
922views
Read a word in XML between elements using sed command
I want to read a word between two xml elements using sed command. For e.g. in below xml, I want to read the number 1234567. <ns1:account> <ns2:name>Corporation</ns2:name> &...
-1votes
1answer
183views
To get the value of specific attribute value as True or False, having uneven columns [duplicate]
I am having one file with the below two lines in the file. I need to check if the value of xpoweredBy is true or false. Many thanks in advance. <Connector clientAuth="false" sslProtocol="TLS"...
0votes
3answers
69views
How to replace a matching string if n+2 line does not contain a particular string
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/...
0votes
1answer
530views
Complex string replace - multiple files, multiple different strings, must include certain text
I have a number of XML files (Atlassian Confluence space exports FYI), that I need to parse through to replace certain strings, as long as the line begins with a set string. Here is an example of a ...
0votes
1answer
2kviews
How to extract the URL from xml or any text file
My XML file; <settings version="2"> <setting id="TimeShift" default="true">0</setting> <setting id="Override" default="true">false</setting> <setting id="...
0votes
1answer
46views
replacement of a string in xml
I am trying to replace folder name value in an xml file.I am searching with required pattern using grep and replace the folder name value which is DF_GCSS with ABC_DEF which comes from a variable....
0votes
4answers
1kviews
need to join only certain lines of a xml file together [duplicate]
I would like to transform this XML to where only certain lines are joined together. This is so I can later grep only specific lines. If this XML used attributes, then the data would already be in 1 ...
4votes
1answer
1kviews
filter xml documents matching certains ids
Suppose you have a file containing many xml documents, like <a> <b> ... </a> in between xml documents there may be plain text log messages <x> ... </x> ... How ...
1vote
1answer
772views
Find a pattern in XML using unix command
I have XML like below <a> </a> <a> <b></b> <c></c> </a> I need to find line numbers of the empty tags which are in two consecutive lines without any ...
2votes
2answers
6kviews
How to find a text, copy it and insert in next line in a file?
I'm trying to write a script that processes .xml file. It has to find all lines with a <title> element, copy it, and paste in a next line after that found one, but also changing the element ...
1vote
3answers
295views
Search for a String, On Success Search for Nearest Pattern
I have an XML file of format, {XML file with similar tags - SubRecord and Property} ... <SubRecord> <Property Name="Name">My Main Search Keyword</Property> <Property Name="...